<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<footer data-role="footer" data-position="fixed">
	<a href="javascript:clear_bag();">장바구니 비우기</a>
	<span id="total_price_area" align="center">
		금액 :
	</span> 
	<span align="right">
		<input type="button" value="결재하기" onclick="javascript:pay_yes('<%=session.getAttribute("store_id")%>');"/>
	</span>
	<form name="pay_form" method="post">
		<input type="text" name="do_pay_list"/>
	</form>
</footer>

<script>

function pay_yes(store_id){
	var result = '';
	for(var i=0; i < localStorage.length; i++){
		var key = localStorage.key(i);
		var  value = localStorage[key];
		if(key != 'total_price'){
			if(key.indexOf(store_id) == 0)
			result += key + '=' +  value + '&';
		}
	}
	document.pay_form.do_pay_list.value= result;
	
}

function clear_bag(){
	$('input[name=quantity_text]').each(function(){
		$(this).val('0');
	});
	localStorage.clear();
	$('#total_price_area').html('금액 : 0');
	
}
</script>